#ifndef LZ_CTOKEN_CPP_2012_11_15
#define LZ_CTOKEN_CPP_2012_11_15
#define TOKENLIST_DECL( M )			\
	M( Number, "0-9" )	\
	M( NNumber, "! 0-9" )	\
	M( Charter, "a-z A-Z" )	\
	M( NCharter, "! a -z A-Z" )	\
	M( ControlCode, "CM" )	\
	M( Space, "\t\n\r" )	\
	M( NSpace, "! \t\n\r" )	\
	M( Name, "a-z A-Z _" )	\
	M( NName, "!a-z A-Z _" )	\
	M( TestB, "TestBegin" )	\
	M( TestE, "TestEnd" )	\
	M( RecordNumber, "Record" )	\
	M( UShort, "DWORD" )	\
	M( String, "abc..." )

#include "KeyDeclear.h"
#include <string>
using namespace std;
namespace MyRegular_Token{
#define ENUMCONSTRUCT( a, b )			\
	ECTT_##a, 
enum ECTokenType{
	ECTT_StartMark = 0x100,
	TOKENLIST_DECL( ENUMCONSTRUCT )
	ECTT_END
};
const char* GetTokenDecl( ECTokenType et );
class CToken{
public:
	CToken() : m_ett( ECTT_END ){ m_itStr = m_strSource.end(); };
	void InitTokenEnv( const char* pszSource ){ m_ett = ECTT_END; m_strSource = pszSource; m_itStr = m_strSource.begin(); };
	int GetNextToken();
	int Token(){ return m_ett; };
	string GetTokenString(){ return m_strBuf; };
	int GetNextOriginalChar();
private:
	static bool IsControlSymbol( char c );
	void GetString1();
	void GetString2();
	int GetConverValue(){ return iConverValue; };
	bool StringTopCheck( char c );
	int ConverFunc();
	int TestHexChar( char c );
private:
	string::iterator	m_itStr;
	ECTokenType m_ett;
	string m_strBuf;
	string m_strSource;
	int iConverValue;
};
class CTestToken{
public:
	CTestToken(){};
	void Test( const char* pszSource );
};
};
#endif